package program

import (
	"github.com/wailsapp/wails/v3/pkg/application"
)

// 打开一个新窗口
func OpenNewWindow(url string, app *application.App) {
	// 创建带配置选项的新窗口
	// 'Title' 设置窗口标题
	// 'Mac' 包含 macOS 系统特有窗口配置
	// 'URL' 指定加载到 webview 中的初始页面
	app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
		Title:         "SoulLantern",
		Width:         1266,
		Height:        708,
		Frameless:     true,
		DisableResize: true,
		Mac: application.MacWindow{
			InvisibleTitleBarHeight: 50,
			Backdrop:                application.MacBackdropTranslucent,
			TitleBar:                application.MacTitleBarHiddenInset,
		},
		BackgroundColour: application.NewRGB(27, 27, 27),
		URL:              url,
	})
}
